<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
  <title>装车单已下发未确认列表</title>
  <meta name="decorator" content="list"/>
</head>
<body title="装车单已下发未确认列表">
<grid:grid id="ccZcdGridId" url="${adminPath}/cc/zcd/ajaxList'" datatype="local" afterInit="true">
    <grid:column label="sys.common.opt"  name="opt" formatter="button" width="100" sortable="false"/>
    <grid:button title="查看明细"  groupname="opt" function="rowDialogCommit" winheight="550px" outclass="btn-primary" url="${adminPath}/cc/zcd/mx/zcdmxNotConfirmList?zhuangcdNo=\"+row.zhuangcdNo+\"" />
    <grid:column label="cc.zcdHz.zhuangcdNo" name="zhuangcdNo" query="true" condition="like"/>
    <grid:column label="cc.zcdHz.facTime" name="facTime" query="true" queryMode="date" condition="between" dateformat="yyyy-MM-dd"/>
    <grid:column label="cc.zcdHz.psy" name="psy" />
    <grid:column label="cc.zcdHz.siji" name="siji" />
    <grid:column label="cc.zcdHz.chepaiNo" name="chepaiNo" />
    <grid:column label="cc.zcdHz.state" name="state" dict="zcdState" query="true" queryMode="select"/>
    <grid:column label="cc.zcdHz.tygs" name="tygs" />
    <grid:column label="cc.zcdHz.backFlg" name="backFlg" dict="sf" query="true" queryMode="select"/>
    <grid:column label="cc.cangku" name="cangku"/>

	<grid:toolbar function="search"/>
	<grid:toolbar function="reset"/>
</grid:grid>

<script>

    function afterInit() {
        debugger
        let queryParams = {
            deliveryState: '1',
            'query.deliveryState||eq': '1'
        };
        let queryFields=$('#queryFields').val();
        queryParams['queryFields'] = queryFields;
        //普通的查询
        $('#ccZcdGridIdGridQuery').find(":input").each(function() {
            let val = $(this).val();
            if (queryParams[$(this).attr('name')]) {
                val = queryParams[$(this).attr('name')] + "," + $(this).val();
            }
            queryParams[$(this).attr('name')] = val;
        });

        // 普通的查询
        $('#ccZcdGridIdGridQuery').find(":input").each(function() {
            let condition = $(this).attr('condition');
            if (!condition) {
                condition = "";
            }
            let key = "query." + $(this).attr('name') + "||" + condition;
            queryParams[key] = queryParams[$(this).attr('name')];
        });

        $("#ccZcdGridIdGrid").jqGrid('setGridParam',{
            postData:queryParams, //发送数据
            datatype:'json',
            mtype:'get',
            url:'${adminPath}/cc/zcd/ajaxList?gridtype=jqgrid',
            prmNames:{
                //请求参数格式预处理
                page:"page.pn",
                rows:"page.size",
                sort:"sort",
                order: "order"
            }
        }).trigger('reloadGrid');
    }

</script>

</body>
</html>